package work.comeback.omo.util.common;

import com.google.gson.Gson;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.io.PrintWriter;

public class HttpUtils {

    private static final Gson GSON = new Gson();

    public static void sendJsonResponse(HttpServletResponse response, Object responseData) throws IOException {
        response.setContentType("application/json");
        response.setCharacterEncoding("UTF-8");
        PrintWriter out = response.getWriter();
        out.print(GSON.toJson(responseData));
        out.flush();
        out.close();
    }
}
